import React, { Component } from 'react';
import One from './One'
import Two from './two/Two'
import {useState} from 'react'
import './TodoList.module.scss'
const Todolist =()=> {
  const [list,setList]=useState({
    list:[
      {name:'小米',data:'2020',priority:1},
      {name:'小名',data:'2023',priority:3},
      {name:'小美',data:'2022',priority:2},
      {name:'小李',data:'2019',priority:1}
    ]
  })
  let todolist=(msg)=>{
    console.log(msg);
    let Lists=list.list
    Lists.push(msg)
    setList({
      list:Lists
    })
  }
    return ( 
      <div className='body'>
          <div className='list'>
              <One todolist={todolist}></One>
              <Two list={list}></Two>
          </div>
      </div>
     );
    }
export default Todolist;